from collections import defaultdict

name_list = ['thomas', 'python', 'python', 'java', 'python', 'thomas', 'c', 'c']
dict_int = defaultdict(int)

for i in name_list:
    dict_int[i] += 1


print(dict_int)
